package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.domain.Depot;
import cn.wolfcode.crm.query.ProductStockQueryObject;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.serivce.IDepotService;
import cn.wolfcode.crm.serivce.IProductStockService;
import cn.wolfcode.crm.util.JSONResult;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;


@Controller
@RequestMapping("productStock")
public class ProductStockController {

    @Autowired
    private IProductStockService productStockService;



    @RequestMapping("view")
    public String view() throws Exception {
        return "productStock";
    }

    @RequestMapping("query")
    @ResponseBody
    public PageResult query(ProductStockQueryObject qo) throws Exception {
        PageResult query = productStockService.query(qo);
        return query;
    }
    @RequestMapping("countByStoreNumber")
    @ResponseBody
    public Integer countByStoreNumber(BigDecimal storeNumber) throws Exception{
        return productStockService.countByStoreNumber(storeNumber);
    }
}
